草庐IT

pdf 上传

全部标签

php - 使用 PHP 上传、调整大小和裁剪图像中心

我想创建一个非常非常基本的上传、调整大小和裁剪PHP脚本。此功能与Twitter用于上传头像图片的方法相同(我最后检查过)。我希望脚本拍摄任意大小的图像,将最短边调整为116像素,然后裁剪顶部和底部(如果是横向,则裁剪左侧和右侧)以获得116像素x116像素的正方形。我不想要一个臃肿的PHP脚本,客户端调整大小或任何东西,只是一个简单的PHP调整大小和裁剪。这是怎么做到的? 最佳答案 GD库是一个很好的起点。http://www.php.net/manual/en/book.image.php

PHP Curl 文件上传发送空上传

我正在尝试转换以下CURL:curl-XPOST\-H"Content-Type:image/jpeg"\--data-binary'@myPicture.jpg'\https://api.parse.com/1/files/pic.jpgPHP:$ch=curl_init();$data=array('myPicture.jpg'=>"@myPicture.jpg");curl_setopt($ch,CURLOPT_POST,true);curl_setopt($ch,CURLOPT_POSTFIELDS,$data);$headers=array();$headers[]="Con

php - 如何在数据库中保存上传文件的名称

续-AddFileUploadertoJoomlaAdminComponent我可以上传文件并将其保存在磁盘上。但是它没有在数据库中保存文件名。我该怎么做?这是Controller-classInvoiceManagerControllerInvoiceManagerextendsJControllerForm{functionsave(){$file=JRequest::getVar('jform',null,'files','array');$path=JPATH_BASE;//Makethefilenamesafe.jimport('joomla.filesystem.file'

php - 如何仅使用扩展名(*.pdf)检查文件是否存在于 php 中

$filename='/www/test1/*.pdf';if(file_exists($filename)){echo"Thefile$filenameexists";}else{echo"Thefile$filenamedoesnotexist";}我使用了上面的代码,但它检查了*.pdf文件,但没有检查所有属于.pdf扩展名的文件 最佳答案 $filename='/www/test1/*.pdf';if(count(glob($filename))>0){echo"Thefile$filenameexists";}else{e

javascript - pdf文件上传ajax html

varfile=$('#image').prop('files')[0];varfilename=$('#af_rpta_propertyland_filename').val();varform_data=newFormData();form_data.append('file',file);alert(form_data);$.ajax({type:'POST',url:'../include/upload.php',//dataType:"json",data:{file:form_data,filename:filename},success:function(data){co

PHP:Adobe Reader 无法打开使用 mpdf 创建的 PDF 文件

我正在使用mpdf即时创建PDF文件,文件在浏览器中打开正常,但Adob​​e给我一个错误:AdobeAcrobatReaderDCcouldnotopen'example-filename.pdf'becauseitiseithernotasupportedfiletypeorbecausethefilehasbeendamaged(forexample,itwassentasanemailattachmentandwasn'tcorrectlydecoded).我查看了与此相关的其他问题(anothermpdf+adobeerror),并在文本编辑器中查看了pdf。我发现文件的第一

php - 我想使用 mpdf 在 PDF 中设置页眉和页脚

我已经使用CodeIgniter中的mpdf库生成了一个PDF。我想附加带有适当边距的页眉图像和页脚图像,我创建了一个代码,但页眉和页脚重叠了。//controller$this->load->library('m_pdf');$param='"","A4","","",0,0,100,0,6,3,"L"';$pdf=$this->m_pdf->load($param);//$pdf->useOddEven=true;$pdf->SetHTMLHeader('');$pdf->SetHTMLFooter('');$wm=base_url().'custom/Watermark.jpg'

php - laravel图像干预是压缩用户上传图像的好方法吗?

我正在检查这个laravel库来压缩用户上传的图像。http://image.intervention.io/我想知道这对用户上传的图片(个人资料图片)是否是个好主意?如果用户上传一张尺寸为1400x600的图片,它会被调整为200x200怎么办?它会是一个拉伸(stretch)的图像吗? 最佳答案 是的,它会被拉伸(stretch)。你想试试fit()方法:Combinecroppingandresizingtoformatimageinasmartway.Themethodwillfindthebestfittingaspect

javascript - 从剪贴板上传图片到服务器

我一直在寻找解决方案,但我找不到任何解决方案。是否有可能将图片从剪贴板上传到服务器上的文件(通过按ctrl+v)?它适用于Chrome。使用PHP、Javascript、jquery或其他什么?Chrome的一些外部扩展?非常感谢。 最佳答案 你可以试试:https://github.com/layerssss/paste.js或者关于粘贴事件和剪贴板APIhttp://www.w3schools.com/jsref/event_onpaste.asphttps://www.w3.org/TR/clipboard-apis/Howd

javascript - 充当文件上传的div?

我只是想上传或浏览div本身,就像作为文件输入并触发它的功能,但我的问题是我是java脚本的新手,我很尴尬地集思广益了将近一个小时,在互联网上寻找同样的问题。所以我别无选择,只能在这里提问我的代码 $('#pic1').click(function(Upload){ $('#fileToUpload').click();}); whilemyfileinputishiddeninsidethediv 最佳答案 $(document).ready(function(){varreadURL=function